<!DOCTYPE HTML>
<html>
<head>
    <title>帮教管理--救助页面</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <script src="/webjars/miniui/boot.js" type="text/javascript"></script>
    <link href="/static/css/resource.css" rel="stylesheet" type="text/css"/>
    <link href="/static/css/default.css" rel="stylesheet" type="text/css"/>
    <script src="/static/js/common/common.js" type="text/javascript"></script>
</head>
<style>
    .delBtn{
        border: 1px solid #ff2120;
        border-radius: 10px;
        font-size:8px;
        line-height: 20px;
        font-weight: bold;
        color: #ff4634;
    }
    .editBtn{
        border: 1px solid #018d00;
        border-radius: 10px;
        font-size:8px;
        line-height: 20px;
        font-weight: bold;
        color: #00a60a;
    }
</style>
<body onload="onLoad()">
<div class="mini-fit" style="padding-top: 20px;margin-bottom: 45px;">
    <form id="form1" method="post" style="padding:10px;">
        <!-- 用户 编辑框START-->
        <div id="editform" class="form" >
            <table class="form-table"  width="100%">
                <input id="id" name="id" class="mini-hidden" value="${id!''}" style="width: 100%;"  readonly/>
                <input id="priNum" name="priNum" class="mini-hidden" value="${priNum!''}" style="width: 100%;"  readonly/>
                <input id="shehuijiuzhu" name="shehuijiuzhu" class="mini-hidden" value="${shehuijiuzhu!''}" style="width: 100%;"  readonly/>
                <input id="edit" name="edit" class="mini-hidden" value="${edit!''}" style="width: 100%;"  readonly/>
                <tr>
                    <td width="20%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>救助时间:</td>
                    <td width="28%">
                        <input class="mini-datepicker" style="width: 100%;" allowInput="false" value="${jztime!''}" id="jztime" name="jztime" required="true" ondrawdate="onDrawDate"/>
                    </td>
                    <td width="10%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>户&emsp;&emsp;籍:</td>
                    <td class="input">
                        <input name="huji" id="huji" class="mini-radiobuttonlist" value="${huji!''}" <#--onvaluechanged="onHjValueChanged"-->
                               data="[{ id: 1, name: '已落户' },{ id: 2, name: '未落户' }]" required="true"
                               textField="name" valueField="id"  required="true"/>
                    </td>
                </tr>
            </table>
        </div>
        <div id="editform1" class="form" >
            <table class="form-table"  width="100%"  >
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;">
                        <input name="zdshbz" id="zdshbz" class="mini-checkbox" style="font-size: 12px;line-height: 12px; font-weight: bold;"
                               truevalue="1" falsevalue="0"
                               value="${zdshbz!''}" text="落实最低生活保障&emsp;&emsp;&emsp;" onvaluechanged="onDbValueChanged" />
                    </td>
                    <td>
                    </td>
                </tr>
            </table>
        </div>

        <div id="editformDb" class="form"  style="display: none">
            <table class="form-table"  width="100%"  >
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>救助推荐: </td>
                    <td>
                        <input name="jzdw01"  id="jzdw01" class="mini-combobox" textField="xtdw" valueField="id" emptyText="请选择..." required="true"
                               style="width: 400px;"  onvaluechanged="onAzjdChanged(1)" url = "/azbj/zfjzbfgl/info/getBfList?bfId=3"
                        /><span id="xs01" ></span>
                    </td>
                    <#--<td width="30%" align="left" style="line-height: 30px;">补贴形式:现金</td>
                    <td width="30%" align="left" style="line-height: 30px;">补贴金额:1000</td>-->
                </tr>
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>落实联系人:</td>
                    <td>
                        <input property="editor" class="mini-textbox" required="true" style="width: 400px;"   value="${dbLxr!''}" id="dbLxr" name="dbLxr"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right"  >低保落实人手机号码:</td>
                    <td class="input">
                        <input property="editor" class="mini-textbox"  style="width:400px;"   value="${dbPhone!''}" id="dbPhone" name="dbPhone" onvaluechanged="checkPhone(1)" emptyText="请输入手机号码"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right"  >低保落实人固话:</td>
                    <td class="input">
                        <input property="editor" class="mini-textbox"  style="width:400px;"   value="${dbTel!''}" id="dbTel" name="dbTel" onvaluechanged="checkPhone(1)" emptyText="请输入固定电话"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;">附件上传:</td>
                    <td>
                        <input type="button" value="上传附件" onclick="onFileUpload('27')">
<#--                        <span  style="color: #8B8B8B" >支持扩展名:.rar .zip .doc .docx .xls .xlsx .pdf .jpg...</span>-->
                        <span id="msg1"></span>
                        <div><b>支持扩展名:</b>.rar .zip .doc .docx .xls .xlsx .pdf .jpg</div>
                    </td>
                </tr>
            </table>
        </div>
        <div id="editform11" class="form" >
            <table class="form-table"  width="100%">
                <tr>
                    <td width="30%" align="right" valign="top" style="line-height: 80px;">备注:</td>
                    <td class="input">
                        <input id="dbRemark" name="dbRemark" class="mini-textarea"  emptyText="请输入内容(0-100):"
                               value="${dbRemark!''}" style="width:400px; height: 60px;"/>
                    </td>
                </tr>
            </table>
        </div>
        <div id="editform2" class="form" >
            <table class="form-table"  width="100%"  >
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;">
                        <input name="tkrygy" id="tkrygy" class="mini-checkbox" style="font-size: 12px;line-height: 12px; font-weight: bold;"
                               truevalue="1" falsevalue="0"    value="${tkrygy!''}" text="落实特困人员供养&emsp;&emsp;&emsp;" onvaluechanged="onTkValueChanged" />
                    </td>
                    <td>
                    </td>
                </tr>
            </table>
        </div>

        <div id="editformTk" class="form"  style="display: none">
            <table class="form-table"  width="100%"  >
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>救助推荐: </td>
                    <td>
                        <input name="jzdw02"  id="jzdw02" class="mini-combobox" textField="xtdw" valueField="id" emptyText="请选择..." required="true"
                               style="width: 40%"  onvaluechanged="onAzjdChanged(2)" url = "/azbj/zfjzbfgl/info/getBfList?bfId=4"
                        /><span id="xs02" ></span>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>落实联系人:</td>
                    <td>
                        <input property="editor" class="mini-textbox"required="true"  style="width: 400px;"   value="${tkLxr!''}" id="tkLxr" name="tkLxr"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" valign="top" >特困落实人手机号码:</td>
                    <td class="input">
                        <input property="editor" class="mini-textbox"  style="width: 400px;"   value="${tkPhone!''}" id="tkPhone" name="tkPhone" onvaluechanged="checkPhone(2)" emptyText="请输入手机号码"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" valign="top" >特困落实人固话:</td>
                    <td class="input">
                        <input property="editor" class="mini-textbox"  style="width: 400px;"   value="${tkTel!''}" id="tkTel" name="tkTel" onvaluechanged="checkPhone(2)" emptyText="请输入固定电话"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;">附件上传:</td>
                    <td>
                        <input type="button" value="上传附件" onclick="onFileUpload('28')">
<#--                        <span  style="color: #8B8B8B" >支持扩展名:.rar .zip .doc .docx .xls .xlsx .pdf .jpg...</span>-->
                        <span id="msg2"></span>
                        <div><b>支持扩展名:</b>.rar .zip .doc .docx .xls .xlsx .pdf .jpg</div>
                    </td>
                </tr>
            </table>
        </div>
        <div id="editform21" class="form" >
            <table class="form-table"  width="100%">
                <tr>
                    <td width="30%" align="right" valign="top" style="line-height: 80px;">备注:</td>
                    <td class="input">
                        <input id="tkRemark" name="tkRemark" class="mini-textarea"  emptyText="请输入内容(0-100):"
                               value="${tkRemark!''}" style="width:400px; height: 60px;"/>
                    </td>
                </tr>
            </table>
        </div>
        <div id="editform3" class="form" >
            <table class="form-table"  width="100%">
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;">
                        <input name="yljz" id="yljz" class="mini-checkbox" style="font-size: 12px;line-height: 12px; font-weight: bold;"
                               truevalue="1" falsevalue="0"   value="${yljz!''}" text="落实医疗救助&emsp;&emsp;&emsp;&emsp;&emsp;" onvaluechanged="onYlValueChanged" />
                    </td>
                    <td>

                    </td>
                </tr>
            </table>
        </div>

        <div id="editformYl" class="form"   style="display: none">
            <table class="form-table"  width="100%">
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>救助推荐: </td>
                    <td >
                        <input name="jzdw03"  id="jzdw03" class="mini-combobox" textField="xtdw" valueField="id" emptyText="请选择..." required="true"
                               style="width: 40%"  onvaluechanged="onAzjdChanged(3)" url = "/azbj/zfjzbfgl/info/getBfList?bfId=5"
                        /><span id="xs03" ></span>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>落实联系人: </td>
                    <td>
                        <input property="editor" class="mini-textbox" required="true" style="width: 400px;"    value="${ylLxr!''}" id="ylLxr" name="ylLxr"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" valign="top" >医疗落实人手机号码:</td>
                    <td class="input">
                        <input property="editor" class="mini-textbox"  style="width: 400px;"    value="${ylPhone!''}" id="ylPhone" name="ylPhone" onvaluechanged="checkPhone(3)" emptyText="请输入手机号码"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" valign="top" >医疗落实人固话:</td>
                    <td class="input">
                        <input property="editor" class="mini-textbox"  style="width: 400px;"    value="${ylTel!''}" id="ylTel" name="ylTel" onvaluechanged="checkPhone(3)" emptyText="请输入固定电话"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;">附件上传:</td>
                    <td>
                        <input type="button" value="上传附件" onclick="onFileUpload('29')">
<#--                        <span  style="color: #8B8B8B" >支持扩展名:.rar .zip .doc .docx .xls .xlsx .pdf .jpg...</span>-->
                        <span id="msg3"></span>
                        <div><b>支持扩展名:</b>.rar .zip .doc .docx .xls .xlsx .pdf .jpg</div>
                    </td>
                </tr>
            </table>
        </div>
        <div id="editform31" class="form" >
            <table class="form-table"  width="100%">
                <tr>
                    <td width="30%" align="right" style="line-height: 80px;">备注:</td>
                    <td class="input">
                        <input id="ylRemark" name="ylRemark" class="mini-textarea"  emptyText="请输入内容(0-100):"
                               value="${ylRemark!''}" style="width:400px; height: 60px;"/>
                    </td>
                </tr>
            </table>
        </div>

        <div id="editform4" class="form" >
            <table class="form-table"  width="100%">
                <tr>
                    </td>
                    <td width="30%" align="right" style="line-height: 30px;">
                        <input name="jyjz" id="jyjz" class="mini-checkbox" style="font-size: 12px;line-height: 12px; font-weight: bold;"
                               truevalue="1" falsevalue="0" value="${jyjz!''}" text="落实教育救助&emsp;&emsp;&emsp;&emsp;&emsp;" onvaluechanged="onJyValueChanged" />
                    </td>
                    <td>

                    </td>
                </tr>
            </table>
        </div>

        <div id="editformJy" class="form"  style="display: none" >
            <table class="form-table"  width="100%">
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>救助推荐: </td>
                    <td>
                        <input name="jzdw04"  id="jzdw04" class="mini-combobox" textField="xtdw" valueField="id" emptyText="请选择..." required="true"
                               style="width: 40%"  onvaluechanged="onAzjdChanged(4)" url = "/azbj/zfjzbfgl/info/getBfList?bfId=10"
                        /><span id="xs04" ></span>
                </tr>
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>落实联系人:</td>
                    <td>
                        <input property="editor" class="mini-textbox" required="true" style="width: 400px;"   value="${jyLxr!''}" id="jyLxr" name="jyLxr"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" valign="top" >教育落实人手机号码:</td>
                    <td class="input">
                        <input property="editor" class="mini-textbox"  style="width: 400px;"    value="${jyPhone!''}" id="jyPhone" name="jyPhone" onvaluechanged="checkPhone(4)" emptyText="请输入手机号码"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" valign="top" >教育落实人固话:</td>
                    <td class="input">
                        <input property="editor" class="mini-textbox"  style="width: 400px;"    value="${jyTel!''}" id="jyTel" name="jyTel" onvaluechanged="checkPhone(4)" emptyText="请输入固定电话"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;">附件上传:</td>
                    <td>
                        <input type="button" value="上传附件" onclick="onFileUpload('30')">
<#--                        <span  style="color: #8B8B8B" >支持扩展名:.rar .zip .doc .docx .xls .xlsx .pdf .jpg...</span>-->
                        <span id="msg4"></span>
                        <div><b>支持扩展名:</b>.rar .zip .doc .docx .xls .xlsx .pdf .jpg</div>
                    </td>
                </tr>
            </table>
        </div>
        <div id="editform41" class="form" >
            <table class="form-table"  width="100%">
                <tr>
                    <td width="30%" align="right" >备注:</td>
                    <td class="input">
                        <input id="jyRemark" name="jyRemark" class="mini-textarea"  emptyText="请输入内容(0-100):"
                               value="${jyRemark!''}" style="width:400px; height: 60px;"/>
                    </td>
                </tr>
            </table>
        </div>
        <div id="editform5" class="form" >
            <table class="form-table"  width="100%">
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;">
                        <input name="zfjz" id="zfjz" class="mini-checkbox" style="width: 300px;font-size: 12px;line-height: 12px; font-weight: bold;"
                               truevalue="1" falsevalue="0" value="${zfjz!''}" text="落实住房救助&emsp;&emsp;&emsp;&emsp;&emsp;" onvaluechanged="onZfValueChanged" />
                    </td>
                    <td>

                    </td>
                </tr>
            </table>
        </div>

        <div id="editformZf" class="form"   style="display: none">
            <table class="form-table"  width="100%">
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>救助推荐: </td>
                    <td>
                        <input name="jzdw05"  id="jzdw05" class="mini-combobox" textField="xtdw" valueField="id" emptyText="请选择..."  required="true"
                               style="width: 40%"  onvaluechanged="onAzjdChanged(5)" url = "/azbj/zfjzbfgl/info/getBfList?bfId=6"
                        /><span id="xs05" ></span>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;"> <font color="#dc143c">*</font>落实联系人: </td>
                    <td>
                        <input property="editor" class="mini-textbox"  required="true" style="width: 400px;"  value="${zfLxr!''}" id="zfLxr" name="zfLxr"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" valign="top" >住房落实人手机号码:</td>
                    <td class="input">
                        <input property="editor" class="mini-textbox"  style="width: 400px;"   value="${zfPhone!''}" id="zfPhone" name="zfPhone" onvaluechanged="checkPhone(5)" emptyText="请输入手机号码"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" valign="top" >住房落实人固话:</td>
                    <td class="input">
                        <input property="editor" class="mini-textbox"  style="width: 400px;"   value="${zfTel!''}" id="zfTel" name="zfTel" onvaluechanged="checkPhone(5)" emptyText="请输入固定电话"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;">附件上传:</td>
                    <td>
                        <input type="button" value="上传附件" onclick="onFileUpload('31')">
<#--                        <span  style="color: #8B8B8B" >支持扩展名:.rar .zip .doc .docx .xls .xlsx .pdf .jpg...</span>-->
                        <span id="msg5"></span>
                        <div><b>支持扩展名:</b>.rar .zip .doc .docx .xls .xlsx .pdf .jpg</div>
                    </td>
                </tr>
            </table>
        </div>
        <div id="editform51" class="form" >
            <table class="form-table"  width="100%">
                <tr>
                    <td width="30%" align="right" style="line-height: 80px;">备注:</td>
                    <td class="input">
                        <input id="zfRemark" name="zfRemark" class="mini-textarea"  emptyText="请输入内容(0-100):"
                               value="${zfRemark!''}" style="width:400px; height: 60px;"/>
                    </td>
                </tr>
            </table>
        </div>
        <div id="editform6" class="form" >
            <table class="form-table"  width="100%">
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;">
                        <input name="qtjz" id="qtjz" class="mini-checkbox" style="width: 300px;font-size: 12px;line-height: 12px; font-weight: bold;"
                               truevalue="1" falsevalue="0"   value="${qtjz!''}" text="落实其他&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;" onvaluechanged="onQtValueChanged" />
                    </td>
                    <td>

                    </td>
                </tr>
            </table>
        </div>
        <div id="editformQt" class="form"  style="display: none" >
            <table class="form-table"  width="100%">
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>救助推荐: </td>
                    <td>
                        <input name="jzdw06"  id="jzdw06" class="mini-combobox" textField="xtdw" valueField="id" emptyText="请选择..." required="true"
                               style="width: 40%"  onvaluechanged="onAzjdChanged(6)" url = "/azbj/zfjzbfgl/info/getBfList?bfId=99"
                        /><span id="xs06"></span>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>落实联系人: </td>
                    <td>
                        <input property="editor" class="mini-textbox"required="true"  style="width: 400px;"   value="${qtLxr!''}" id="qtLxr" name="qtLxr"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" valign="top" >其他落实人手机号码:</td>
                    <td class="input">
                        <input property="editor" class="mini-textbox"  style="width: 400px;"   value="${qtPhone!''}" id="qtPhone" name="qtPhone" onvaluechanged="checkPhone(6)" emptyText="请输入手机号码"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" valign="top" >其他落实人固话:</td>
                    <td class="input">
                        <input property="editor" class="mini-textbox"  style="width: 400px;"   value="${qtTel!''}" id="qtTel" name="qtTel" onvaluechanged="checkPhone(6)" emptyText="请输入固定电话"/>
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;">附件上传:</td>
                    <td>
                        <input type="button" value="上传附件" onclick="onFileUpload('32')">
<#--                        <span  style="color: #8B8B8B" >支持扩展名:.rar .zip .doc .docx .xls .xlsx .pdf .jpg...</span>-->
                        <span id="msg6"></span>
                        <div><b>支持扩展名:</b>.rar .zip .doc .docx .xls .xlsx .pdf .jpg</div>
                    </td>
                </tr>

            </table>
        </div>

        <div id="editform6" class="form" >
            <table class="form-table"  width="100%">
                <tr>
                    <td width="30%" align="right" style="line-height: 80px;">备注:</td>
                    <td class="input">
                        <input id="qtRemark" name="qtRemark" class="mini-textarea"   emptyText="请输入内容(0-100):"
                               value="${qtRemark!''}" style="width:400px; height: 60px;" />
                    </td>
                </tr>
            </table>
        </div>
    </form>
</div>

<div style="width: 100%;position: absolute;bottom: 0;line-height: 45px;border-top:1px solid #dfdfdf;text-align: center">
    <a class="mini-button" iconCls="fa-save" plain="true" onclick="saveData()">保存</a>
    <a class="mini-button" iconCls="fa-undo" plain="true" onclick="close('close')">取消</a>
</div>

<script type="text/javascript">
    mini.parse();

    var form = new mini.Form("form1");
    var priNumObj = mini.get("priNum");
    var idObj = mini.get("id");
    var editObj = mini.get("edit");
    var zdshbzObj = mini.get("zdshbz");//最低生活保障-复选框
    var tkrygyObj = mini.get("tkrygy");//特困人员供养-复选框
    var yljzObj = mini.get("yljz");//医疗救助-复选框
    var jyjzObj = mini.get("jyjz");//教育救助-复选框
    var zfjzObj = mini.get("zfjz");//住房救助-复选框
    var qtjzObj = mini.get("qtjz");//其他救助-复选框
    var dbLxrObj = mini.get("dbLxr");//低保联系人
    var dbTel = mini.get("dbTel");//低保联系人固定电话
    var dbPhone = mini.get("dbPhone");//低保联系人手机号码
    var tkLxrObj = mini.get("tkLxr");//特困联系人
    var tkTel = mini.get("tkTel");//特困联系人固定电话
    var tkPhone = mini.get("tkPhone");//特困联系人手机号码
    var ylLxrObj = mini.get("ylLxr");//医疗联系人
    var ylTel = mini.get("ylTel");//医疗联系人固定电话
    var ylPhone = mini.get("ylPhone");//医疗联系人手机号码
    var jyLxrObj = mini.get("jyLxr");//教育联系人
    var jyTel = mini.get("jyTel");//教育联系人固定电话
    var jyPhone = mini.get("jyPhone");//教育联系人手机号码
    var zfLxrObj = mini.get("zfLxr");//住房联系人
    var zfTel = mini.get("zfTel");//住房联系人固定电话
    var zfPhone = mini.get("zfPhone");//住房联系人手机号码
    var qtLxrObj = mini.get("qtLxr");//其他联系人
    var qtTel = mini.get("qtTel");//其他联系人固定电话
    var qtPhone = mini.get("qtPhone");//其他联系人手机号码
    var shjzObj = mini.get("shehuijiuzhu");//社会救助方式集合
    var hujiObj = mini.get("huji");//户籍

    // 页面一加载
    function onLoad(){
        analysisShjz();
        onDbValueChanged();
        onTkValueChanged();
        onYlValueChanged();
        onJyValueChanged();
        onZfValueChanged();
        onQtValueChanged();
        onHjValueChanged();
    }

    //1:低保；2:特困；3:医疗；4:教育；5:住房；6:其他
    function analysisShjz(){
        var shjzVal = shjzObj.getValue();
        if(shjzVal.match(RegExp(/[1]/))){
            zdshbzObj.setValue(true);
        }else{
            zdshbzObj.setValue(false);
        }
        if(shjzVal.match(RegExp(/[2]/))){
            tkrygyObj.setValue(true);
        }else{
            tkrygyObj.setValue(false);
        }
        if(shjzVal.match(RegExp(/[3]/))){
            yljzObj.setValue(true);
        }else{
            yljzObj.setValue(false);
        }
        if(shjzVal.match(RegExp(/[4]/))){
            jyjzObj.setValue(true);
        }else{
            jyjzObj.setValue(false);
        }
        if(shjzVal.match(RegExp(/[5]/))){
            zfjzObj.setValue(true);
        }else{
            zfjzObj.setValue(false);
        }
        if(shjzVal.match(RegExp(/[6]/))){
            qtjzObj.setValue(true);
        }else{
            qtjzObj.setValue(false);
        }
    }

    //1:低保；2:特困；3:医疗；4:教育；5:住房；6:其他
    function getShjz(){
        var shjzVal = "";
        var zdshbzVal =  zdshbzObj.getValue();//最低生活保障-复选框
        var tkrygyzVal =  tkrygyObj.getValue();//特困人员供养-复选框
        var yljzVal =  yljzObj.getValue();//医疗救助-复选框
        var jyjzVal =  jyjzObj.getValue();//教育救助-复选框
        var zfjzVal =  zfjzObj.getValue();//住房救助-复选框
        var qtjzVal =  qtjzObj.getValue();//其他救助-复选框

        if(zdshbzVal=="1"){
            shjzVal+="01,"
        }
        if(tkrygyzVal=="1"){
            shjzVal+="02,"
        }
        if(yljzVal=="1"){
            shjzVal+="03,"
        }
        if(jyjzVal=="1"){
            shjzVal+="04,"
        }
        if(zfjzVal=="1"){
            shjzVal+="05,"
        }
        if(qtjzVal=="1"){
            shjzVal+="06,"
        }
        shjzVal = shjzVal.substr(0,shjzVal.length-1);
        return shjzVal;
    }

    function checkPhone(val){
        if(val == '1'){
            //低保联系方式校验
            var phone = dbPhone.getValue();
            var telPhone = dbTel.getValue();
            var newPhone = checkTelAndPhone(telPhone,phone);
            var flag = newPhone['flag'];
            var kflag = newPhone['kflag'];
            if ('-1' === kflag) {
                mini.alert("请至少输入一个低保联系人联系方式");
                return;
            }
            if (flag) {
            } else {
                mini.alert("低保联系人手机号码或固定电话有误,请重填!");
                return;
            }
            return true;
        } else if (val == '2') {
            //特困联系方式校验
            var phone = tkPhone.getValue();
            var telPhone = tkTel.getValue();
            var newPhone = checkTelAndPhone(telPhone,phone);
            var flag = newPhone['flag'];
            var kflag = newPhone['kflag'];
            if ('-1' === kflag) {
                mini.alert("请至少输入一个特困联系人联系方式");
                return;
            }
            if (flag) {
            } else {
                mini.alert("特困联系人手机号码或固定电话有误,请重填!");
                return;
            }
            return true;
        } else if(val == '3') {
            //医疗联系方式校验
            var phone = ylPhone.getValue();
            var telPhone = ylTel.getValue();
            var newPhone = checkTelAndPhone(telPhone,phone);
            var flag = newPhone['flag'];
            var kflag = newPhone['kflag'];
            if ('-1' === kflag) {
                mini.alert("请至少输入一个医疗联系人联系方式");
                return;
            }
            if (flag) {
            } else {
                mini.alert("医疗联系人手机号码或固定电话有误,请重填!");
                return;
            }
            return true;
        } else if(val == '4') {
            //教育联系方式校验
            var phone = jyPhone.getValue();
            var telPhone = jyTel.getValue();
            var newPhone = checkTelAndPhone(telPhone,phone);
            var flag = newPhone['flag'];
            var kflag = newPhone['kflag'];
            if ('-1' === kflag) {
                mini.alert("请至少输入一个教育联系人联系方式");
                return;
            }
            if (flag) {
            } else {
                mini.alert("教育联系人手机号码或固定电话有误,请重填!");
                return;
            }
            return true;
        } else if(val == '5') {
            //住房联系方式校验
            var phone = zfPhone.getValue();
            var telPhone = zfTel.getValue();
            var newPhone = checkTelAndPhone(telPhone,phone);
            var flag = newPhone['flag'];
            var kflag = newPhone['kflag'];
            if ('-1' === kflag) {
                mini.alert("请至少输入一个住房联系人联系方式");
                return;
            }
            if (flag) {
            } else {
                mini.alert("住房联系人手机号码或固定电话有误,请重填!");
                return;
            }
            return true;
        } else if(val == '6'){
            //其他联系方式校验
            var phone = qtPhone.getValue();
            var telPhone = qtTel.getValue();
            var newPhone = checkTelAndPhone(telPhone,phone);
            var flag = newPhone['flag'];
            var kflag = newPhone['kflag'];
            if ('-1' === kflag) {
                mini.alert("请至少输入一个其他联系人联系方式");
                return;
            }
            if (flag) {
            } else {
                mini.alert("其他联系人手机号码或固定电话有误,请重填!");
                return;
            }
            return true;
        }
    }
    function onDrawDate(e) {
        var date = e.date;
        var d = new Date();
        if (date.getTime() > d.getTime()) {
            e.allowSelect = false;
        }
    }

    function saveData() {
        form.validate();
        if (form.isValid() == false) {
            mini.alert("信息录入不完整，请检查");
            return;
        }

        var zdshbzVal =  zdshbzObj.getValue();//最低生活保障-复选框
        if(zdshbzVal==="1"&&!checkPhone(1)){
            return;
        }

        var tkrygyzVal =  tkrygyObj.getValue();//特困人员供养-复选框
        if(tkrygyzVal==="1"&&!checkPhone(2)){
            return;
        }

        var yljzVal =  yljzObj.getValue();//医疗救助-复选框
        if(yljzVal==="1"&&!checkPhone(3)){
            return;
        }

        var jyjzVal =  jyjzObj.getValue();//教育救助-复选框
        if(jyjzVal==="1"&&!checkPhone(4)){
            return;
        }

        var zfjzVal =  zfjzObj.getValue();//住房救助-复选框
        if(zfjzVal==="1"&&!checkPhone(5)){
            return;
        }

        var qtjzVal =  qtjzObj.getValue();//其他救助-复选框
        if(qtjzVal==="1"&&!checkPhone(6)){
            return;
        }
        //校验通过后组装phone和tel，组装格式为phone|tel
        if (zdshbzVal === '1') {
            dbTel.setValue(dbPhone.getValue()+"|"+dbTel.getValue());
        }
        if (tkrygyzVal === '1') {
            tkTel.setValue(tkPhone.getValue()+"|"+tkTel.getValue());
        }
        if (yljzVal === '1') {
            ylTel.setValue(ylPhone.getValue()+"|"+ylTel.getValue());
        }
        if (jyjzVal === '1') {
            jyTel.setValue(jyPhone.getValue()+"|"+jyTel.getValue());
        }
        if (zfjzVal === '1') {
            zfTel.setValue(zfPhone.getValue()+"|"+zfTel.getValue());
        }
        if (qtjzVal === '1') {
            qtTel.setValue(qtPhone.getValue()+"|"+qtTel.getValue());
        }
        var data = form.getData();
        data.shehuijiuzhu = getShjz();
        var json = mini.encode(data);
        data.edit = editObj.getValue();
        $.ajax({
            url: "/azbj/azbjgl/bjgzgl/saveJzInfo",
            type: "post",
            data: {data: json},
            success: function (result) {
                if (result.code == 1) {
                    mini.alert("保存成功","成功",function(){
                        window.CloseOwnerWindow('ok');
                    });
                }else if (result.code == 5599) {
                    mini.alert(result.message);
                } else {
                    mini.alert("保存失败");
                }
            }
        });
    }

    //户籍单选框
    function onHjValueChanged(){
        var hjVal = hujiObj.getValue();
        if(hjVal=="1"){
            if(document.getElementById("editformHj")!=null){
                document.getElementById("editformHj").style.display="block";
            }
        }else{
            if(document.getElementById("editformHj")!=null) {
                document.getElementById("editformHj").style.display = "none";
            }
        }
    }

    //低保复选框
    function onDbValueChanged(){
        var zdshbzVal = zdshbzObj.getValue();
        if(zdshbzVal=="1"){
            document.getElementById("editformDb").style.display="block";
        }else{
            document.getElementById("editformDb").style.display="none";
        }
    }

    //特困复选框
    function onTkValueChanged(){
        var tkrygyVal = tkrygyObj.getValue();
        if(tkrygyVal=="1"){
            document.getElementById("editformTk").style.display="block";
        }else{
            document.getElementById("editformTk").style.display="none";
        }
    }


    //医疗复选框
    function onYlValueChanged(){
        var yljzVal = yljzObj.getValue();
        if(yljzVal=="1"){
            document.getElementById("editformYl").style.display="block";
        }else{
            document.getElementById("editformYl").style.display="none";
        }
    }

    //教育复选框
    function onJyValueChanged(){
        var jyjzVal = jyjzObj.getValue();
        if(jyjzVal=="1"){
            document.getElementById("editformJy").style.display="block";
        }else{
            document.getElementById("editformJy").style.display="none";
        }
    }

    //住房复选框
    function onZfValueChanged(){
        var zfjzVal = zfjzObj.getValue();
        if(zfjzVal=="1"){
            document.getElementById("editformZf").style.display="block";
        }else{
            document.getElementById("editformZf").style.display="none";
        }
    }
    //其他复选框
    function onQtValueChanged(){
        var qtjzVal = qtjzObj.getValue();
        if(qtjzVal=="1"){
            document.getElementById("editformQt").style.display="block";
        }else{
            document.getElementById("editformQt").style.display="none";
        }
    }

    function onAzjdChanged(e){
        var id = "";
        if(1 == e){
            id = mini.get("jzdw01").getValue();
            var data = getBfInfo(id);
            document.getElementById("xs01").innerText = data;
        }else if(2 == e){
            id = mini.get("jzdw02").getValue();
            var data = getBfInfo(id);
            document.getElementById("xs02").innerText = data;
        }else if(3 == e){
            id = mini.get("jzdw03").getValue();
            var data = getBfInfo(id);
            document.getElementById("xs03").innerText = data;
        }else if(4 == e){
            id = mini.get("jzdw04").getValue();
            var data = getBfInfo(id);
            document.getElementById("xs04").innerText = data;
        }else if(5 == e){
            id = mini.get("jzdw05").getValue();
            var data = getBfInfo(id);
            document.getElementById("xs05").innerText = data;
        }else if(6 == e){
            id = mini.get("jzdw06").getValue();
            var data = getBfInfo(id);
            document.getElementById("xs06").innerText = data;
        }
    }

    function getBfInfo(id) {
        var mess = ""
        $.ajax({
            url: "/azbj/zfjzbfgl/info/getBfInfo?id=" + id,
            type: "get",
            async:false,
            success: function (data) {
                mess = data;
            }
        });
        return mess;
    }

    //附件上传
    function onFileUpload(taskid) {
        var idval = idObj.getValue();
        if(!idval){
            idval = 'noid';
        }
        var prival = priNumObj.getValue();
        var url = "/upload/user/uploadAppendixfile/view?1=1&id="+idval+"&priNum="+prival+"&taskId=" + taskid;

        commonEdit(url, null, null,600, 400, true,true,true,callback);
        // 回调函数
        function callback() {
            // alert(taskid);
            $.ajax({
                url: "/upload/downloadAppendixFile/getCountById?1=1&priNum=" + prival + "&taskId=" + taskid + "&id="+idval,
                type: "get",
                success: function (success) {
                    if (taskid == '27') {
                        $("#msg1").text("上传成功" + success.data + "条!");
                    } else if (taskid == '28') {
                        $("#msg2").text("上传成功" + success.data + "条!");
                    } else if (taskid == '29') {
                        $("#msg3").text("上传成功" + success.data + "条!");
                    } else if (taskid == '30') {
                        $("#msg4").text("上传成功" + success.data + "条!");
                    } else if (taskid == '31') {
                        $("#msg5").text("上传成功" + success.data + "条!");
                    } else if (taskid == '32') {
                        $("#msg6").text("上传成功" + success.data + "条!");
                    }
                }
            })
            grid.reload();
        }
    }

    function close(action){
        if(window.CloseOwnerWindow){
            window.CloseOwnerWindow(action);
        }else{
            window.close();
        }
    }

    // 获取页面的id priNum等
    function GetData(){
        var idval = idObj.getValue();
        var priNum1 = priNumObj.getValue();
        var data = {priNum: priNum1, id: idval,taskId:['27','28','29','30','31','32']}
        return data;
    }

    // 页面一加载
    window.onLoad = function (){
        //查询上传文件数量
        $("#msg1").text("上传成功" + ${count1} + "条!")
        $("#msg2").text("上传成功" + ${count2} + "条!")
        $("#msg3").text("上传成功" + ${count3} + "条!")
        $("#msg4").text("上传成功" + ${count4} + "条!")
        $("#msg5").text("上传成功" + ${count5} + "条!")
        $("#msg6").text("上传成功" + ${count6} + "条!")
        var jzdw01 = mini.get("jzdw01");
        var jzdw02 = mini.get("jzdw02");
        var jzdw03 = mini.get("jzdw03");
        var jzdw04 = mini.get("jzdw04");
        var jzdw05 = mini.get("jzdw05");
        var jzdw06 = mini.get("jzdw06");

        if(jzdw01.data.length>0){
            mini.get("zdshbz").setValue("1");
            document.getElementById("editformDb").style.display="block";
        }
        if(jzdw02.data.length>0){
            mini.get("tkrygy").setValue("1");
            document.getElementById("editformTk").style.display="block";
        }
        if(jzdw03.data.length>0){
            mini.get("yljz").setValue("1");
            document.getElementById("editformYl").style.display="block";
        }
        if(jzdw04.data.length>0){
            mini.get("jyjz").setValue("1");
            document.getElementById("editformJy").style.display="block";
        }
        if(jzdw05.data.length>0){
            mini.get("zfjz").setValue("1");
            document.getElementById("editformZf").style.display="block";
        }
        if(jzdw06.data.length>0){
            mini.get("qtjz").setValue("1");
            document.getElementById("editformQt").style.display="block";
        }
        jzdw01.setValue("${jzdw01!''}");
        jzdw01.setText("${xtdw01!''}");
        jzdw02.setValue("${jzdw02!''}");
        jzdw02.setText("${xtdw02!''}");
        jzdw03.setValue("${jzdw03!''}");
        jzdw03.setText("${xtdw03!''}");
        jzdw04.setValue("${jzdw04!''}");
        jzdw04.setText("${xtdw04!''}");
        jzdw05.setValue("${jzdw05!''}");
        jzdw05.setText("${xtdw05!''}");
        jzdw06.setValue("${jzdw06!''}");
        jzdw06.setText("${xtdw06!''}");
        if("${jzdw01!''}".length>0){
            var data = getBfInfo("${jzdw01!''}");
            document.getElementById("xs01").innerText = data;
        }if("${jzdw02!''}".length>0){
            var data = getBfInfo("${jzdw02!''}");
            document.getElementById("xs02").innerText = data;
        }if("${jzdw03!''}".length>0){
            var data = getBfInfo("${jzdw03!''}");
            document.getElementById("xs03").innerText = data;
        }if("${jzdw04!''}".length>0){
            var data = getBfInfo("${jzdw04!''}");
            document.getElementById("xs04").innerText = data;
        }if("${jzdw05!''}".length>0){
            var data = getBfInfo("${jzdw05!''}");
            document.getElementById("xs05").innerText = data;
        }if("${jzdw06!''}".length>0){
            var data = getBfInfo("${jzdw06!''}");
            document.getElementById("xs06").innerText = data;
        }
    }
</script>
</body>
</html>